import request from "../utils/request";

export default {
    // 创建专栏
    createColumn(data) {
        return request({
            url: `/article/articleColumn/create_column`,
            method: "post",
            data
        });
    },

    // 查询专栏列表
    columnList(data) {
        return request({
            url: `/article/api/articleColumn/columnList`,
            method: "post",
            data
        });
    },

    // 根据专栏ID查询专栏信息
    columnInfo(columnId) {
        return request({
            url: `/article/api/articleColumn/columnInfo`,
            method: "get",
            params: {
                columnId
            }
        });
    },

    // 获取专栏文章列表
    getColumnArticle(data = {}) {
        return request({
            url: `/article/api/articleColumn/getColumnArticle`,
            method: "post",
            data
        });
    },

    // 编辑专栏信息
    editColumn(data) {
        return request({
            url: `/article/articleColumn/editColumn`,
            method: "post",
            data
        });
    },

    // 删除专栏
    delColumn(columnId) {
        return request({
            url: `/article/articleColumn/delColumn`,
            method: "GET",
            params: {
                columnId
            }
        });
    },

    // 添加或者删除专栏中的文章
    manageColumnArticle(data ={}) {
        return request({
            url: `/article/articleColumn/manageColumnArticle`,
            method: "POST",
            data
        });
    },

    // 关注或取消关注专栏
    followColumn(data ={}) {
        return request({
            url: `/article/articleColumn/followColumn`,
            method: "POST",
            data
        });
    },

    // 检查用户是否关注了某个专栏
    checkFollow(userId, columnId) {
        return request({
            url: `/article/articleColumn/checkFollow`,
            method: "GET",
            params: {
                userId,
                columnId
            }
        });
    },

    // 获取用户关注的专栏信息
    getUserFollowColumn(data ={}) {
        return request({
            url: `/article/api/articleColumn/getUserFollowColumn`,
            method: "POST",
            data
        });
    },

    // 获取用户创建文章时可以选择的所有专栏
    userColumnList() {
        return request({
            url: `/article/articleColumn/columnList`,
            method: "GET"
        });
    },


}